import request from '@/utils/request'

const api_name = '/serviceEdu/course'

export default {

    saveCourseInfo(courseInfo) {
        return request({
            url: `${api_name}/addCourseInfo`,
            method: 'post',
            data: courseInfo
        })
    },

    getCourseInfoById(id){
        return request({
            url: `${api_name}/courseInfo/${id}`,
            method: 'get',
        })
    },

    updateCourseInfoById(courseInfo){
        return request({
            url: `${api_name}/updateCourseInfo/${courseInfo.id}`,
            method: 'put',
            data: courseInfo
        })
    },

    // 条件分页课程列表
    pageCourseQuery(page,limit,courseQuery){
        return request({
            url: `${api_name}/pageCourseQuery/${page}/${limit}`,
            method: 'get',
            params: courseQuery
        })
    },

    // 根据ID删除课程
    removeCourse(id){
        return request({
            url: `${api_name}/removeCourse/${id}`,
            method: 'delete'
        })
    }
}
